exports.CustomButton = function(_args) {
	if(Ti.Platform.osname== 'android') {
  		// backgroundImage= '../windows/images/popover/PopoverPortrait.png';
  		// arrowimage='../windows/images/popover/PopoverPortraitArrow.png';
  		 Titanium.include('../globals.js');
  		// Titanium.include('../cs/cs.js');
  		// Titanium.include('../windows/ModalActivityIndicatorWindow.js');
  		// topfirst=30,leftfirst=40,leftsecond=200,heightlabel=21,right=40,heighttext=50,space=10
    }
    else {
   		 // backgroundImage= 'windows/images/popover/PopoverPortrait.png';
   		//  arrowimage='windows/images/popover/PopoverPortraitArrow.png';
   		  Titanium.include('globals.js');
   		//  topfirst=30,leftfirst=40,leftsecond=200,heightlabel=21,right=40,heighttext=31,space=10
	
    }
	var view = Ti.UI.createView({
		backgroundImage:'images/btOn.png',
		height:45,
		width:_args.width,
		left:_args.left,
	});
	var lb1 = Ti.UI.createLabel({
			width:Ti.UI.SIZE,
			height:Ti.UI.SIZE,
			color:'#000',
			text:_args.title,
			//left:10,
			width:'auto',
	});
	view.addEventListener('click', function(e)
	{
		Ti.App.fireEvent('removecontrol_TableViewPanel');
		Ti.App.fireEvent('addcontrol_TableViewPanel');
		
		var ScrollViewParent=view.getParent();
		var length=ScrollViewParent.children.length;
		for (i = 0; i < length; i++) {
		   //get View
           var viewparent =ScrollViewParent.children[i];
           viewparent.backgroundImage='images/btOn.png';
           //Get label
           var labelparent =viewparent.children[0];
           labelparent.color='#000';
        }
		
		view.backgroundImage=Globals.btSelectImage;//'images/bar.jpg';
		lb1.color='white'
		Ti.App.fireEvent(_args.even);
		
		Titanium.API.info(ScrollViewParent.children[0] )
	});
	view.add(lb1);
	
	if(_args.isSelect !== undefined) {
       view.backgroundImage=Globals.btSelectImage;//'images/bar.jpg';
	   lb1.color='white'
    }
	
	
	return view;
};